<template>
	<view class="enterprise">
		<z-paging
			ref="paging"
			:refresher-out-rate="0.8"
			:auto-clean-list-when-reload="false"
			:auto-scroll-to-top-when-reload="false"
			bg-color="#fff"
			:refresher-status.sync="refresherStatus"
			@query="queryList"
		>
		<view v-if="FormList.videoUrl != ''">
			<video style="width: 100%;height: 210px;" id="myVideo"  :src="FormList.videoUrl" controls> </video>
		</view>
		<view class="enterprise_details">
			<view class="enterprise_top">
				<text class="enterprise_bg"></text>
				<u-text text="公司介绍" size="32rpx" bold/>
			</view>
			<u-gap height="32rpx"></u-gap>
			<text class="enterprise_top_t">{{FormList.info || '暂无公司介绍'}}</text>
		</view>
		<u-gap height="14rpx" bgColor="#F5F5F5;" ></u-gap>
		<view class="enterprise_details">
			<view class="enterprise_top">
				<text class="enterprise_bg"></text>
				<u-text text="公司荣誉" size="32rpx" bold/>
			</view>
			<u-gap height="32rpx"></u-gap>
			<view class="enterprise_img">
				<u-image
					width="100%"
					lazyLoad
					:src="item"
					v-for="(item, index) in HpList"
					mode="widthFix"
					height="auto"
					:key="item"
				/>
			</view>
		</view>
		</z-paging>
	</view>
</template>

<script>
	import { enterprise , noenterprise} from '@/api/enterprise.js';
	import { mapGetters } from 'vuex';
	export default {
		data() {
			return {
				FormList:{},
				HpList:[]
			}
		},
		computed: {
			...mapGetters(['isLogin'])
		},
		onLoad(options) {
			this.videourl = options.videourl
			this.tenantId = options.tenantId
			this.getEnterprise(this.tenantId);
		},
		mounted: function (res) {
			var that = this;
			uni.getSystemInfo({
				success: function (res) {
					that.windowHeight = res.windowHeight;
				}
			});
		},
		methods: {
			async getEnterprise(tenantId){//获取企业信息
				if (this.isLogin) {
					const res = await enterprise(tenantId)
					this.FormList = res.data
					this.HpList = res.data.honorPictures.split(",") 
				}else{
					const res = await noenterprise()
					this.FormList = res.data
					this.HpList = res.data.honorPictures.split(",") 
				}
			},
			videoErrorCallback: function(e) {
			},
			queryList(pageNo, pageSize) {
				setTimeout(() => {
					// this.$refs.paging.complete([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
					this.$refs.paging.completeByTotal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 20);
				}, 500);
				this.getEnterprise(this.tenantId);
			}
		}
	}
</script>

<style scoped lang="scss">
	/* 企業頁面 */
	.enterprise{
		background: #FFFFFF;
		width: 100%;
		height: 100vh;
		color: #333333;
	}
	.enterprise_details{
		padding:32rpx 28rpx;
	}
	.enterprise_top{
		display: flex;
		height: 44rpx;
		align-items: center;
	}
	.enterprise_bg{
		display: block;
		width: 8rpx;
		height: 28rpx;
		background: #588BF3;
		margin-right: 8rpx;
	}
	.enterprise_img{
		width: 100%;box-sizing: border-box;
	}
</style>
